package com.jy.event.dao;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;

import java.util.Date;
import java.util.List;
import java.util.Map;

/**
 * Created by lihu on 2018/1/22.
 */
public class MemberDaoImpl {

    @Autowired
    JdbcTemplate jdbcTemplate;


    public List<Map<String, Object>> getMemberInfo() {
        String sql = "select b.`id`,a.`code` ,a.`mobile` ,a.`name` ,b.`store_id`,a.id member_id " +
                " from member a left join member_account b on(a.id=b.member_id)" +
                " where b.`add_time` >? or a.update_time>?  ";
        Date date = new Date(new Date().getTime() - 5 * 1000 * 60);
        return jdbcTemplate.queryForList(sql, date, date);
    }
}
